package com.chen.cloud.micro.consumer.movie.api;

import com.chen.cloud.micro.consumer.movie.dto.User;
import com.chen.cloud.micro.consumer.movie.fallback.UserFeignClientFallbackFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//@FeignClient(name = "micro-provider-user", configuration = FeignDisableHystrixConfiguration.class)
@FeignClient(name = "micro-provider-user", fallbackFactory = UserFeignClientFallbackFactory.class)
public interface UserFeignClient {

    @RequestMapping(value = "/user/v1/{id}", method = RequestMethod.GET)
    User findById(@PathVariable("id") Long id);

    @RequestMapping(value = "user/v1/create", method = RequestMethod.POST)
    User create(@RequestBody User user);

}
